package com.example.guardian.myadapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.guardian.R;
import java.util.List;

public class TCaseAdapter extends ArrayAdapter<com.example.guardian.myadapter.TCase>{
    private int resourceId;

    public TCaseAdapter(Context context, int textViewResourceId, List<com.example.guardian.myadapter.TCase> objects){
        super(context, textViewResourceId,objects);
        resourceId=textViewResourceId;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        com.example.guardian.myadapter.TCase tCase = getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(resourceId, parent,
                false);
        TextView tcase_name = (TextView) view.findViewById(R.id.txt_case_title);
        tcase_name.setText(tCase.getCase_name());
        TextView tcase_con = (TextView) view.findViewById(R.id.txt_case_content);
        tcase_con.setText(tCase.getCase_content());


        return view;
    }


}
